package phyml.view;

import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

import javax.swing.*;

/**
 * Project: grisu
 * <p/>
 * Written by: Markus Binsteiner
 * Date: 19/08/13
 * Time: 9:33 AM
 */
public class InputDataForm {

    private JPanel inputDataPanel;
    private JTextField sequencesPhylipFormatTextField;
    private JButton browseButton;
    private JCheckBox useExampleFileCheckBox;
    private JRadioButton DNARadioButton;
    private JRadioButton aminoAcidsRadioButton;
    private JRadioButton interleavedRadioButton;
    private JRadioButton sequentialRadioButton;
    private JSpinner numberOfDataSetsSpinner;
    private JTextField runIDTextField;

    public static void main(String[] args) {
        JFrame frame = new JFrame("InputDataForm");
        frame.setContentPane(new InputDataForm().inputDataPanel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }

    private void createUIComponents() {

    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        inputDataPanel = new JPanel();
        inputDataPanel.setLayout(new FormLayout("fill:d:noGrow,left:20dlu:noGrow,fill:24px:grow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
        final JLabel label1 = new JLabel();
        label1.setText("Sequences (Phylip format)");
        CellConstraints cc = new CellConstraints();
        inputDataPanel.add(label1, cc.xy(1, 1));
        sequencesPhylipFormatTextField = new JTextField();
        inputDataPanel.add(sequencesPhylipFormatTextField, cc.xyw(3, 1, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
        browseButton = new JButton();
        browseButton.setText("Browse");
        inputDataPanel.add(browseButton, cc.xy(7, 1));
        useExampleFileCheckBox = new JCheckBox();
        useExampleFileCheckBox.setText("Use example file");
        inputDataPanel.add(useExampleFileCheckBox, cc.xyw(5, 3, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
        final JLabel label2 = new JLabel();
        label2.setText("Data Type");
        inputDataPanel.add(label2, cc.xy(1, 5));
        DNARadioButton = new JRadioButton();
        DNARadioButton.setSelected(true);
        DNARadioButton.setText("DNA");
        inputDataPanel.add(DNARadioButton, cc.xy(5, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));
        aminoAcidsRadioButton = new JRadioButton();
        aminoAcidsRadioButton.setText("Amino-acids");
        inputDataPanel.add(aminoAcidsRadioButton, cc.xy(7, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));
        final JLabel label3 = new JLabel();
        label3.setText("Sequence File Format");
        inputDataPanel.add(label3, cc.xy(1, 7));
        interleavedRadioButton = new JRadioButton();
        interleavedRadioButton.setSelected(true);
        interleavedRadioButton.setText("Interleaved");
        inputDataPanel.add(interleavedRadioButton, cc.xy(5, 7, CellConstraints.LEFT, CellConstraints.DEFAULT));
        sequentialRadioButton = new JRadioButton();
        sequentialRadioButton.setText("Sequential");
        inputDataPanel.add(sequentialRadioButton, cc.xy(7, 7, CellConstraints.LEFT, CellConstraints.DEFAULT));
        final JLabel label4 = new JLabel();
        label4.setText("Number of Data Sets");
        inputDataPanel.add(label4, cc.xy(1, 9));
        numberOfDataSetsSpinner = new JSpinner();
        inputDataPanel.add(numberOfDataSetsSpinner, cc.xyw(3, 9, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
        final JLabel label5 = new JLabel();
        label5.setText("Run ID");
        inputDataPanel.add(label5, cc.xy(1, 11));
        runIDTextField = new JTextField();
        inputDataPanel.add(runIDTextField, cc.xyw(3, 11, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
        label1.setLabelFor(sequencesPhylipFormatTextField);
        label4.setLabelFor(numberOfDataSetsSpinner);
        label5.setLabelFor(runIDTextField);
        ButtonGroup buttonGroup;
        buttonGroup = new ButtonGroup();
        buttonGroup.add(interleavedRadioButton);
        buttonGroup.add(interleavedRadioButton);
        buttonGroup.add(sequentialRadioButton);
        buttonGroup = new ButtonGroup();
        buttonGroup.add(DNARadioButton);
        buttonGroup.add(DNARadioButton);
        buttonGroup.add(aminoAcidsRadioButton);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return inputDataPanel;
    }
}
